home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 117
/
FreelogNo117-OctobreNovembre2013.iso
/
Programmation
/
jedit
/
jedit5.1.0install.exe
/
{app}
/
macros
/
Clipboard
/
Copy_Visible_Lines.bsh
< prev
next >
Wrap
Text File
|
2013-07-28
|
897b
|
35 lines
/*
* Copy_Visible_Lines.bsh - Copies visible (non-folded) lines from
* the current buffer to the clipboard.
*
* Copyright (C) 2002-2004 Ollie Rutherfurd <oliver@jedit.org>
*
* $Id: Copy_Visible_Lines.bsh 5098 2004-08-03 21:31:48Z orutherfurd $
*/
void copyVisibleLines(View view){
JEditTextArea textArea = view.getTextArea();
DisplayManager dm = textArea.getDisplayManager();
StringBuffer buff = new StringBuffer();
for(int i=0; i < buffer.getLineCount(); i++){
if(dm.isLineVisible(i))
buff.append(textArea.getLineText(i)).append('\n');
}
Registers.setRegister('$', buff.toString());
}
copyVisibleLines(view);
/*
<listitem>
<para><filename>Copy_Visible_Lines.bsh</filename></para>
<abstract><para>Copies the visible lines from the current
buffer to the Clipboard. Lines that are not visible
becuase they are folded are not copied.
</para></abstract>
</listitem>
*/